import Vue from 'vue'
import App from './App'
import uView from 'uview-ui'
import store from './store/auth'

// #ifndef VUE3
import './uni.promisify.adaptor'
Vue.config.productionTip = false
App.mpType = 'app'

// 使用uView UI
Vue.use(uView)

// 设置环境变量
const env = process.env.NODE_ENV || 'development'
Vue.prototype.$env = env

const app = new Vue({
  ...App,
  store
})
app.$mount()
// #endif

// #ifdef VUE3
import { createSSRApp } from 'vue'
import * as Pinia from 'pinia'

export function createApp() {
  const app = createSSRApp(App)
  
  // 创建 Pinia 实例
  const store = Pinia.createPinia()
  app.use(store)
  
  return {
    app,
    Pinia
  }
}
// #endif